<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 解构可以解构对象或数组
        // 它的作用是获取对象或者数组中的成员值
        let obj = {name:'jack',age:20,address:'广州',qq:'12345'}

        // let obj1 = {age:20,address:'广州',qq:'12345'}

        // let name = obj.name
        // let age = obj.age

        // let {name,age} = obj
        // console.log(name,age)

        // 需求：我们获取除了name之外的其它所有的属性值，并生成一个新的对象
        // let {name,qq,...a} = obj
        // console.log(name)
        // console.log(a)

        let arr = [1,3,5,7,9]
        // Rest element must be last element
        let [a,...b] = arr
        console.log(a,b)
    </script>
</body>
</html>